package com.yuantong.xyerp.core.provider.dao;

import com.yuantong.xyerp.core.api.dto.RoleDto;
import com.yuantong.xyerp.core.api.dto.UserDto;
import com.yuantong.xyerp.core.api.model.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @since 2021-06-23
 */
@Mapper
public interface RoleMapper {

    List<RoleDto> findAllRole(@Param("fuzzyParam") String fuzzyParam);

    int addRole(@Param("role") RoleDto roleDto);

    // @Select({"select id,name from t_role r " +
    //         " where r.name = #{roleName} and r.status = 1"})
    RoleDto findRoleByUser(UserDto userDto);

    Role findRoleByName(RoleDto roleDto);

    int delete(RoleDto roleDto);
}
